import React from "react";


class payFailure extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            callbackUrl: ""
        }
    }

    componentWillMount() {
        document.title = "支付失败";
    }

    componentDidMount() {
        const query = this.props.location.query;
        this.setState({
            callbackUrl: query.callbackUrl
        })
    }

    returnApp() {
        window.location.href = this.state.callbackUrl + "://failed";
    }

    render() {
        return (
            <div>
                <div className="pay-success-title">
                    <div>用户取消或支付失败</div>
                </div>

                <div className="ding-pay-success-back">
                    <div className="buttonBox bgf"><button className="blueBtn" onClick={this.returnApp.bind(this)} >返回</button></div>
                </div>
            </div>
        )
    }
}

export default payFailure;